package ym.ecrm.web.action.systemManagement;

import java.util.LinkedList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import ym.ecrm.core.common.exception.MessageException;
import ym.ecrm.core.dto.systemManagement.UserDTO;
import ym.ecrm.core.service.systemManagement.ISystemService;
import ym.ecrm.web.action.base.BaseAction;

import com.opensymphony.xwork2.ActionContext;

/**
 * 
 * @author Princess
 * 
 */
@Controller
public class GetUserInfoAction extends BaseAction{

	private List<UserDTO> root = new LinkedList<UserDTO>();
	
	@Autowired
	private ISystemService systemService;
	
	public String execute() throws Exception {
		UserDTO user = (UserDTO) ActionContext.getContext().getSession().get("user");
		root.add(user);
		if(user.getUserId() != null){
				return proccess();
		}else {
			return processException(new MessageException("登陆超时，请重新登陆"));
		}
	}
	
	public List<UserDTO> getRoot(){
		return root;
	}
	
	public String getErrorMessage(){
		return errorMessage;
	}
	
	public String getSuccess(){
		return success;
	}
}